package com.erp.sell.domain;

import com.erp.common.annotation.Excel;
import com.erp.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * --- 不丢始终 ---
 *
 * @author lzx
 * @date 2025/9/2
 * @desc 销售订单
 */
@Data
public class ErpSalesOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单ID，主键 */
    @Excel(name = "订单ID")
    private Long orderId;

    /** 用户ID，操作人 */
    @Excel(name = "用户ID")
    private Long userId;

    /** 总价格 */
    @Excel(name = "总价格")
    private Double totalAmt;

    /** 下单时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "下单时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date orderTime;

    /** 订单状态：1-交易中,2-已完成,3-已取消 */
    @Excel(name = "订单状态", readConverterExp = "1=交易中,2=已完成,3=已取消")
    private Integer status;

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("orderId", getOrderId())
                .append("userId", getUserId())
                .append("totalAmt", getTotalAmt())
                .append("orderTime", getOrderTime())
                .append("status", getStatus())
                .toString();
    }
}
